package com.shell.qq;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
//接收从上个activity传递过来的数据，不保存数据，注册成功之后的信息展示页面
public class RegSuccessActivity extends AppCompatActivity implements View.OnClickListener {

    private EditText username;
    private EditText pwd;
    private EditText phone;
    private EditText Email;
    private Button toLogin;
    private Bundle bundle;//类似于Map集合

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reg_success);
        init();
    }

    public void init() {
        username = findViewById(R.id.username);
        pwd = findViewById(R.id.pwd);
        phone = findViewById(R.id.phone);
        Email = findViewById(R.id.Email);
        toLogin = findViewById(R.id.toLogin);
        toLogin.setOnClickListener(this);//绑定接听器
        Intent intent = getIntent();
        bundle = intent.getExtras();
        username.setText(bundle.getString("username"));
        pwd.setText(bundle.getString("password"));
        phone.setText(bundle.getString("phone"));
        Email.setText(bundle.getString("Email"));
    }

    @Override
    public void onClick(View v) {
        if (v.getId()==R.id.toLogin){
            finish();
        }
    }


}